package cn.sharp.bbs.dao.score;

import cn.sharp.bbs.entity.DO.Datadict;
import cn.sharp.bbs.entity.DO.Reward;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @className: ScoreDao
 * @description: TODO 类描述
 * @author: 王晓崧
 * @date: 2022/7/11
 **/
public interface ScoreDao {
    Long getPostPublisher(Long postID);

    Integer getPostScore(Long postID);

    @Select("select ddict_name from t_data_dict where ddict_type=#{type} and ddict_code=#{code}")
    String getNameByDict(Datadict datadict);

    @Select("select ddict_code from t_data_dict where ddict_type=#{type} and ddict_name=#{name}")
    int getCodeByDict(Datadict datadict);

    int checkOwner(Long u_id, Long postID);

    int checkUnlock(Long u_id, Long postID);

    int checkCompleted(Long postID);

    Integer getUserScore(Long u_id);

    String getIntegralContent(Long postID);

    List<Reward> getRewardList(Long postID);

    int checkHasCont(Long postID);
}
